
<!DOCTYPE html>
<html>
{[include file="_header.tpl"]}
<body>

<header class="navbar navbar-fixed-top bs-docs-nav">
    {[include file="_nav.tpl"]}
</header>

<main id="main" role="main">

    <div class="container docs-wrapper">
        <div class="row">
            <section id="content" class="col-lg-9 col-md-8 col-sm-8 col-xs-12">
                <h3>在线设备</h3>
                <table class="table table-bordered">
					<tr align="center">
						<td>序号</td>
						<td>时间</td>
						<td>设备</td>
						<td>流量</td>
						<td>操作</td>
					</tr>
					{[foreach name=outer key=key item=item from=$result]} 
					{[assign var="no" value="`$key+$pager->from+1`"]}
					{[assign var="t3" value="`$t3+$item.bytes`"]}
					<tr align="center">
						<td>{[$no]}</td>
						<td>{[$item.createtime]}</td>
						<td>{[$item.mac_t|default:$item.mac]}</td>
						<td>{[$item.bytes|printsize]}</td>
						<td><a href="javascript:void(0)" onclick="offline({[$item.id]})" class="btn btn-primary" role="button">下线</a></td>
					</tr>
					{[/foreach]}
					<tr align="center">
						<td colspan="3"></td>
						<td>{[$t3|printsize]}</td>
						<td></td>
					</tr>
				</table>
                
                <div class="text-center">
                    <ul id='pager'></ul>
                </div>

            </section>

            <aside id="sidebar" class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
                {[include file="_left.tpl"]}
            </aside>

        </div>
    </div>
</main>

{[include file="_footer.tpl"]}

{[include file="_pager.tpl"]}

<script type="text/javascript">

function offline(id) {
	
	if (!confirm("确认是否强制此设备下线？")) {
		return false;
	}
	
	var url = "?do=Log.offline&id=" + id;
	
	window.open(url, '_self');
}
</script>

</body>
</html>
